program palindromeTest;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

function IsPalindrome(s: String): Boolean; overload;
var
  i, len: byte;
begin
  len := Length(s);
  if len < 2 then begin
    Result := True;
    Exit;
  end;

  for i := 1 to len shr 1 do
    if s[i] <> s[len + 1 - i] then begin
      Result := False;
      Exit;
    end;
  Result := True;
end;

begin
  try
    writeln(IsPalindrome('1001'));
    writeln(IsPalindrome('1002001'));

    readln;
    { TODO -oUser -cConsole Main : Insert code here }
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.
